package com.input.note;



import java.util.HashMap;
import java.util.Map;

import com.clock.note.Clock_Remind;
import com.slz.note.MainActivity;
import com.slz.note.R;
import com.web.note.HttpTookit;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageButton;
import android.widget.Toast;

public class input_note extends Activity {
	private Button but2;
	private EditText edit1;
	private EditText edit2;
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_note);
		 but2=(Button)findViewById(R.id.but2);
		 but2.setOnClickListener(new OnClickListener() {
				
				@Override
			     public void onClick(View v) {
					
					   edit1= (EditText)findViewById(R.id.headline);
					   edit2= (EditText)findViewById(R.id.content);
					   String headline=edit1.getText().toString();
					   String content=edit2.getText().toString();
					   
					   String result = null;
					    Map<String, String> params = new HashMap<String, String>();
						params.put("text", content);
						params.put("title", headline);
						params.put("photoUrl", "");
						params.put("ZT", "1");
						String path = "http://1.wwjhweb.duapp.com/servlet/addNote";
						try {
							result = HttpTookit.save(path, HttpTookit.POST, params);
						} catch (Exception e) {
							// TODO Auto-generated catch block
							e.printStackTrace();
						}
							Toast.makeText(input_note.this, "我靠，你大爷的，上传成功了" +result,
									Toast.LENGTH_SHORT).show();
				}
			});
	}


	
	   
}
